package site.shenjie.jdbctemplate.model;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import site.shenjie.common.model.Regexps;

/**
 * @author ShenJie
 * 2022/2/15 18:06
 */
@Data
public class InsertUserParam {
    @NotBlank(message = "姓名不能为空")
    @Length(max = 8, message = "姓名最多八个字")
    private String name;

    @NotBlank(message = "手机号必填")
    @Pattern(regexp = Regexps.PHONE, message = "手机号格式不正确")
    private String phone;

    @Email(message = "邮箱格式不正确")
    private String email;

    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = Regexps.PASSWORD, message = "密码应至少包含数字和字母")
    private String password;
}
